package com.huangsm.book.designmodel.jvm.jit;

/**
 * 使用JIT编译器
 * --XX:CompileThreshold
 * 和-XX:+PrintCompilation
 *
 * -client -XX:CompileThreshold=1500 -XX:+PrintCompilation -XX:+CITime
 * @author huang
 * @date 2019/2/25
 */
public class JITDemo {
    static long i=0;
    /**
     * JIT编译测试函数
     */
    public static void  testJIT(){
        i++;

    }

    public static void main(String[] args) {
        //不足1500次，testJIT()不会被JIT编译
        for (int i1 = 0; i1 < 1588; i1++) {
            testJIT();
        }
    }

    @Override
    protected  Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
